<template>
    <div>
        <van-goods-action>
            <van-goods-action-icon :icon="collect?'star':'star-o'" @click="coll"  :text="collect?'已收藏':'未收藏'" color="#ff5000" />
            <van-goods-action-icon icon="cart-o"  :badge="cartNum"  text="购物车" />
            <van-goods-action-button type="danger" text="立即购买" />
            <van-goods-action-button type="warning" text="加入购物车" @click="goCart" />
          </van-goods-action>
    </div>
</template>

<script>
export default {
    name: 'YxGoodtabbuy',
    props:['cartNum'],
    data() {
        return {
            collect:false
        };
    },

    mounted() {
        
    },

    methods: {
        coll(){
            this.collect=!this.collect
        },
        goCart(){
           this.$emit('goCart');
        }
    },
};
</script>

<style lang="scss" scoped>
.van-goods-action{
    z-index: 9999;
}
</style>